package Test.ThirdFive;

import Test.ThirdOne.Student;
import Test.ThirdOne.Teacher;

/**
 * Grade成绩类
 * 成员变量：Course              课程
 *         Teacher             教师
 *         Student             学生
 *         paperGrade          卷面成绩
 *         experimentGrade     实验成绩
 *         dailyGrade          平时成绩
 *
 */
public class Grade {

    private Course course;
    private Teacher teacher;
    private Student student;

    /**
     * @int paperGrade          卷面成绩
     * @int experimentGrade     实验成绩
     * @int dailyGrade          平时成绩
     */
    private int paperGrade;
    private int experimentGrade;
    private int dailyGrade;

    /**
     * 带参数构造器
     */
    public Grade(Course course,Teacher teacher,Student student,int paperGrade,int experimentGrade,int dailyGrade) {
        this.course             = course;
        this.teacher            = teacher;
        this.student            = student;
        this.paperGrade         = paperGrade;
        this.experimentGrade    = experimentGrade;
        this.dailyGrade         = dailyGrade;
    }

    /**
     * 覆盖Object超类toString()方法
     * @return Grade信息
     */
    @Override
    public String toString() {
        return "课程名："+course.getCourseName()+" 教师："+teacher.getName()+" 学生:"+student.getName()+" 成绩："+(paperGrade+experimentGrade+dailyGrade)/3;
    }

    public Course getCourse() {
        return course;
    }

    public void setCourse(Course course) {
        this.course = course;
    }

    public Teacher getTeacher() {
        return teacher;
    }

    public void setTeacher(Teacher teacher) {
        this.teacher = teacher;
    }

    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
    }

    public int getPaperGrade() {
        return paperGrade;
    }

    public void setPaperGrade(int paperGrade) {
        this.paperGrade = paperGrade;
    }

    public int getExperimentGrade() {
        return experimentGrade;
    }

    public void setExperimentGrade(int experimentGrade) {
        this.experimentGrade = experimentGrade;
    }

    public int getDailyGrade() {
        return dailyGrade;
    }

    public void setDailyGrade(int dailyGrade) {
        this.dailyGrade = dailyGrade;
    }

    public static void main(String[] args) {
        Teacher teacher=new Teacher("王林", '女',34,12,"信软学院");
        Student student=new Student("毛建国",'男',19,12,03);
        Course course=new Course("JAVA",64);
        Grade grade=new Grade(course,teacher,student,98,98,98);
        System.out.println(grade);
    }
}
